<?php
session_start();
if (!((isset($_SESSION['id']))&($_SESSION['identity']=="管理员"))) {
echo "<script>alert('非法操作，请先登录！');location.href='../login.php';</script>";
} else {
	header("Content-Type: text/html;charset=utf-8");
	error_reporting(0); //禁止错误输出
	include("../config.inc.php");
	 $sql=" update doctor set name='{$_POST['姓名']}', password='{$_POST['密码']}', office='{$_POST['科室']}', introduce='{$_POST['简介']}' where id='{$_POST['工号']}';"; 
	$res=$link->query($sql);
	if($res){
	 echo "<script>alert('修改成功')</script>";
	 echo "<script>window.location.href='chakanyisheng.php'</script>";
	}else{
	 echo "<script>alert('修改失败')</script>";
	 echo "<script>window.location.href='xiugaiyisheng.php'</script>";
	}
}
?>